package com.bltec.emergency.service.mgrService.impl;

import com.bltec.emergency.mapper.RoleMapper;
import com.bltec.emergency.model.Role;
import com.bltec.emergency.service.mgrService.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service("roleService")
public class RoleServiceImpl implements RoleService {

    @Resource
    RoleMapper roleMapper;


    @Override
    public boolean add(Role role) {
        return roleMapper.insert(role);
    }

    @Override
    public List<Role> getAll() {
        return roleMapper.getAll();
    }

    @Override
    public Role getRoleById(Long id) {
        return roleMapper.getRoleById(id);
    }

    @Override
    public boolean updateRoleById(Role role) {
        return roleMapper.updateRoleById(role);
    }

    @Override
    public boolean deleteRoleById(Long id) {
        return roleMapper.setDisableById(id);
    }
}
